#include <stdio.h>

/* derivado de repetenc/s06.c */

int main()
{
  int n;       /* numero dado */
  int fator;   /* candidato a fator do numero dado */
  int mult;    /* multiplicidade de fator */

  do {
    printf("\nn: ");
    scanf("%d", &n);
    fator = 2;
    while (n > 1) {
      for (mult=0; n%fator;++mult, n/=fator)
        ;
      if (mult != 0) {
        printf("%d*%d ", fator, mult); 
      }
      fator++; 
    }
  } while (n != 0);
  
  return 0;
}
